﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace TVersityDotNet.Providers
{
    /// <summary>
    /// Interface for communicating with REST services, abstracting the specific communications concerns
    /// </summary>
    public interface IRestProvider
    {
        /// <summary>
        /// Get a resource at the specified URL
        /// </summary>
        /// <param name="url">URL where the resource exists</param>
        /// <returns>Data stream from the response</returns>
        Stream Get(string url);

        /// <summary>
        /// Post data to a resource
        /// </summary>
        /// <param name="url">Resource to which the data is posted</param>
        /// <param name="postData">Data being posted</param>
        /// <returns>Data stream from the response</returns>
        Stream Post(string url, byte[] data);

        /// <summary>
        /// Put data to the specified resource
        /// </summary>
        /// <param name="url">Resource to which the data is put</param>
        /// <param name="data">Data being put</param>
        /// <returns>Data stream from the response</returns>
        Stream Put(string url, byte[] data);

        /// <summary>
        /// Delete a resource
        /// </summary>
        /// <param name="url">Resource to be deleted</param>
        /// <returns>Data stream from the response</returns>
        Stream Delete(string url);
    }
}
